package com.study.constant;

/**
 * @author mjy
 * @date 2021/12/07
 * @description
 */
public final class Constants {

    //包的分隔符
    public static final String MESSAGE_SUFFIX = "#";

    //一条指令中，每个位置的分隔符号
    public static final String MESSAGE_SEPARATED = ",";

    //消息类型比如v2,ka之类的位置(一号位从0开始)
    public static final int MESSAGE_TYPE_INDEX = 2;

    //设备身份令牌位置
    public static final int DEVICE_CARD_INDEX = 1;

    // 设备通讯数据的编码
    public static final String DEVICE_DATA_CHARSET = "utf-8";

    /**
     * 前缀存储redis
     */
    //设备在线前缀
    public static final String DEVICE_ONLINE_PREFIX = "DEVICE_ONLINE_";

    //设备指令存前缀
    public static final String COMMAND_PREFIX="COMMAND_PREFIX_";

    //存储设备在线
    public static final int DEVICE_ONLINE = 1;

    //设置空闲检测时间为 600s
    public static final int READER_IDLE_TIME = 600;

    //设备指令回复消息的类型
    public static final String MESS_TYPE = "V4";


    // 指令状态1:发送，2：发送失败，3：指令不需要
    public static final int COMMAND_NOT_RESPONSE = 1;
    public static final int COMMAND_SEND_FAILED = 2;
    public static final int COMMAND_NO_SAVE = 3;
    public static final int COMMAND_NEED_SAVE = 4;


}
